#include "iot_os.h"
#include "iot_network.h"
#include "log.h"

int platform_wait_network_ready(int timeout_sec){
    T_OPENAT_NETWORK_STATUS status = {0};
    int ready = 1;
    while(timeout_sec < 0 || timeout_sec > 0){
        iot_network_get_status(&status);
        if(status.state == OPENAT_NETWORK_LINKED){
            debugf("network ready");
            ready = 1;
            break;
        }
        iot_os_sleep(1000);
        timeout_sec --;
    }
    return ready;
}

void platform_network_init(){

}